var reverseList = function (head) {
  if (head === null || head.next === null) return head;
  let prev = null;
  let curr = head;
  while (curr) {
    // 用于临时存储 curr 的后继节点
    let next = curr.next;
    // 反转
    curr.next = prev;
    // 更新
    prev = curr;
    curr = next;
  }
  head = prev;
  return head;
};
